<div class="row">
    <div class="col-md-12">
        <div class="table-responsive">
            <table class="table">
                <thead>
                <tr>
                    <th>奖品名称</th>
                    <th>奖品类型</th>
                    <th>有效期</th>
                    <th>奖品来源</th>
                    <th>奖品资源状态</th>
                    <th>库存</th>
                    <th>被抽中</th>
                    <th>被锁定</th>
                    <th>当前可用库存</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @forelse($prizes as $prize)
                    <tr>
                        <input class="order_id" type="hidden" value="{{$prize['orderId']}}">
                        <td>{{$prize['name']}}</td>
                        <td>{{$prize['typeName']}}</td>
                        <td>
                            @if(empty($prize['expiredStart']))
                                <div>N/A</div>
                            @else
                                <div>{{$prize['expiredStart']}}</div>
                                <div>{{$prize['expiredEnd']}}</div>
                            @endif
                        </td>
                        <td>{{$prize['resource']}}</td>
                        @if($prize['payStatus']==='')
                            @if($prize['expiredEnd']>date('Y-m-d H:i:s'))
                                <td>可使用</td>
                            @else
                                <td>已过期</td>
                            @endif
                        @else
                            <td>
							<?php
							switch ($prize['payStatus']) {
								case App\Models\PrizePayment\PrizePayment::PAY_UNPAID:
									echo '未支付';
									break;
								case App\Models\PrizePayment\PrizePayment::PAY_COMMIT:
									echo '提交支付';
									break;
								case App\Models\PrizePayment\PrizePayment::PAY_CANCLE:
									echo '支付取消';
									break;
								case App\Models\PrizePayment\PrizePayment::PAY_SUCCESS:
									echo '支付成功';
									break;
								case App\Models\PrizePayment\PrizePayment::PAY_FINISH:
									echo '支付结束';
									break;
								case App\Models\PrizePayment\PrizePayment::PAY_FAIL:
									echo '支付失败';
									break;
								case App\Models\PrizePayment\PrizePayment::REFUND_COMMIT:
									echo '退款提交';
									break;
								case App\Models\PrizePayment\PrizePayment::REFUND_SUCCESS:
									echo '退款成功';
									break;
							}
							?>
                        @endif
                        <td>{{$prize['stockNumber']}}</td>
                        <td>{{$prize['recordNumber']}}</td>
                        <td>{{$prize['lockNumber']}}</td>
                        <td>{{$prize['availableNumber']}}</td>
                        <td>
                            <div class="btn-group operate-group" id="{{$prize['id']}}">
                                @if($prize['payStatus']==App\Models\PrizePayment\PrizePayment::PAY_UNPAID)
                                    @if($prize['typeCode']=='wechat' || $prize['typeCode']=='alipay')
                                        <div><a href="javascript:void(0);"
                                                class="pay operate-btn">支付</a></div>
                                    @endif
                                    @if($prize['typeCode']=='entity')
                                        <div><a href="javascript:void(0);"
                                                class="entry operate-btn">入库</a></div>
                                    @endif
                                    @if(in_array($prize['typeCode'],array(\App\Models\PrizeType\PrizeType::ENTITY,\App\Models\PrizeType\PrizeType::WECHAT,\App\Models\PrizeType\PrizeType::ALIPAY)))
                                        <div><a href="javascript:void(0);"
                                                class="detail operate-btn">详情</a></div>
                                    @endif
                                    @if( in_array($prize['typeCode'],array(\App\Models\PrizeType\PrizeType::ENTITY)))
                                        <div class="dropdown">
                                            <a href="javascript:void(0);"
                                               class="dropdown-toggle"
                                               data-toggle="dropdown">
                                                更多
                                                <span class="caret"></span>
                                            </a>
                                            <ul class="dropdown-menu dropdown-menu-right">
                                                @if($prize['typeCode']=='entity')
                                                    <li><a href="javascript:void(0);"
                                                           class="delivery operate-btn">出库</a></li>
                                                @endif
                                                <li><a href="javascript:void(0);"
                                                       class="modify operate-btn">编辑</a></li>
                                                @if($prize['typeCode']=='entity')
                                                    <li><a href="javascript:void(0);"
                                                           class="delete operate-btn">删除</a></li>
                                                @endif
                                            </ul>
                                        </div>
                                    @endif
                                    @if($prize['typeCode']==\App\Models\PrizeType\PrizeType::COUPON)
                                        <div><a href="javascript:void(0);"
                                                class="modify operate-btn">编辑</a></div>
                                        <div><a href="javascript:void(0);"
                                                class="delete operate-btn">删除</a></div>
                                            {{--href="/web/prize/import-voucher-code/{{ $prize['id'] }}"--}}
                                            <div><a href="javascript:void(0);" data-id="{{ $prize['id'] }}" class="import operate-btn">导入劵码</a></div>
                                    @endif
                                @endif
                            </div>
                        </td>
                    </tr>
                @empty
                    <tr>
                        <td colspan="10">暂时没有数据</td>
                    </tr>
                @endforelse
                </tbody>
            </table>
            {{$paginate->links()}}
        </div>
    </div>
</div>